<template>
  <van-sticky>
    <van-nav-bar
      :title="titleValue"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    >
      <template #right v-if="titleValue === '详情'">
        <Feedback></Feedback>
      </template>
    </van-nav-bar>
  </van-sticky>
</template>

<script>
import Feedback from "@/components/Home/Feedback";
export default {
  props: ["title"],
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    onClickRight() {
      console.log(1);
    },
  },
  computed: {
    titleValue() {
      return this.title === undefined ? "详情" : this.title;
    },
  },
  components: {
    Feedback,
  },
};
</script>

<style></style>
